import { ref } from 'vue'
import { defineStore } from 'pinia'

const useUserStore = defineStore(
  'user',
  () => {
    // 记录用户登录状态
    const token = ref('')

    const clearToken = () => {
      token.value = ''
    }

    return { token, clearToken }
  },
  {
    unistorage: true,
  }
)

export default useUserStore
